package com.example.yuejian21.nongfusanquan.yuejian21.model;

import com.example.yuejian21.nongfusanquan.yuejian21.javabean.Coursebean;
import com.example.yuejian21.nongfusanquan.yuejian21.javabean.Matchbean;
import com.example.yuejian21.nongfusanquan.yuejian21.javabean.Searchbean;
import com.example.yuejian21.nongfusanquan.yuejian21.javabean.Userbean;
import com.example.yuejian21.nongfusanquan.yuejian21.javabean.Userinfo;
import com.example.yuejian21.nongfusanquan.yuejian21.service.MatchService;
import com.example.yuejian21.nongfusanquan.yuejian21.service.SearchService;
import com.example.yuejian21.nongfusanquan.yuejian21.service.UserService;

import java.util.List;

import retrofit2.Call;
import retrofit2.Retrofit;
import retrofit2.converter.gson.GsonConverterFactory;

/**
 * Created by Nongfusanquan on 2017-10-19.
 */

public class Searchmodel {
    private Retrofit retrofit;
    public Searchmodel() {
        retrofit = new Retrofit.Builder()
                .baseUrl("http://10.0.2.2/yuejian14/index.php/API/")
                .addConverterFactory(GsonConverterFactory.create())
                .build();
    }
    public Call<List<Coursebean>> searchCourselist(String search){
        SearchService activityService = retrofit.create(SearchService.class);
        return activityService.searchCourselist(search);
    }

    public Call<Userinfo> getUser(String user_id){
        UserService personService = retrofit.create(UserService.class);
        return personService.getUser(user_id);
    }
}
